(function(){"use strict";BX.namespace("BX.SidePanel");BX.SidePanel.Slider=function(t,e){e=BX.type.isPlainObject(e)?e:{};this.options=e;this.contentCallback=BX.type.isFunction(e.contentCallback)?e.contentCallback:null;this.contentCallbackInvoved=false;this.contentClassName=BX.type.isNotEmptyString(e.contentClassName)?e.contentClassName:null;this.url=this.contentCallback?t:this.refineUrl(t);this.offset=null;this.hideControls=e.hideControls===true;this.width=BX.type.isNumber(e.width)?e.width:null;this.cacheable=e.cacheable!==false;this.autoFocus=e.autoFocus!==false;this.printable=e.printable===true;this.allowChangeHistory=e.allowChangeHistory!==false;this.allowChangeTitle=BX.type.isBoolean(e.allowChangeTitle)?e.allowChangeTitle:null;this.data=new BX.SidePanel.Dictionary(BX.type.isPlainObject(e.data)?e.data:{});this.customLeftBoundary=null;this.customRightBoundary=null;this.setCustomLeftBoundary(e.customLeftBoundary);this.setCustomRightBoundary(e.customRightBoundary);this.title=null;this.setTitle(e.title);this.iframe=null;this.iframeSrc=null;this.iframeId=null;this.requestMethod=BX.type.isNotEmptyString(e.requestMethod)&&e.requestMethod.toLowerCase()==="post"?"post":"get";this.requestParams=BX.type.isPlainObject(e.requestParams)?e.requestParams:{};this.opened=false;this.hidden=false;this.destroyed=false;this.loaded=false;this.handleFrameKeyDown=this.handleFrameKeyDown.bind(this);this.handleFrameFocus=this.handleFrameFocus.bind(this);this.handlePopupInit=this.handlePopupInit.bind(this);this.layout={overlay:null,container:null,loader:null,content:null,closeBtn:null,printBtn:null};this.cache=new BX.Cache.MemoryCache;this.loader=BX.type.isNotEmptyString(e.loader)||BX.type.isElementNode(e.loader)?e.loader:BX.type.isNotEmptyString(e.typeLoader)?e.typeLoader:"default-loader";this.animation=null;this.animationDuration=BX.type.isNumber(e.animationDuration)?e.animationDuration:200;this.startParams={translateX:100,opacity:0};this.endParams={translateX:0,opacity:40};this.currentParams=null;this.overlayAnimation=false;this.label=new BX.SidePanel.Label(this,{iconClass:"side-panel-label-icon-close",iconTitle:BX.Loc.getMessage("MAIN_SIDEPANEL_CLOSE"),onclick:function(t,e){e.close()}});var i=BX.type.isPlainObject(e.label)?e.label:{};this.label.setText(i.text);this.label.setColor(i.color);this.label.setBgColor(i.bgColor,i.opacity);this.newWindowLabel=null;this.copyLinkLabel=null;if(!this.isSelfContained()){if(e.newWindowLabel===true){this.newWindowLabel=new BX.SidePanel.Label(this,{iconClass:"side-panel-label-icon-new-window",iconTitle:BX.Loc.getMessage("MAIN_SIDEPANEL_NEW_WINDOW"),bgColor:["#d9dcdf",100],onclick:function(t,e){Object.assign(document.createElement("a"),{target:"_blank",href:e.getUrl()}).click()}})}if(e.copyLinkLabel===true){this.copyLinkLabel=new BX.SidePanel.Label(this,{iconClass:"side-panel-label-icon-copy-link",iconTitle:BX.Loc.getMessage("MAIN_SIDEPANEL_COPY_LINK"),bgColor:["#d9dcdf",100]});BX.clipboard.bindCopyClick(this.copyLinkLabel.getIconBox(),{text:function(){var t=document.createElement("a");t.href=this.getUrl();return t.href}.bind(this)})}}if(this.url.indexOf("crm.activity.planner/slider.php")!==-1&&e.events&&BX.type.isFunction(e.events.onOpen)&&e.events.compatibleEvents!==false){var n=e.events.onOpen;delete e.events.onOpen;e.events.onLoad=function(t){n(t.getSlider())}}if(e.events){for(var s in e.events){if(BX.type.isFunction(e.events[s])){BX.addCustomEvent(this,BX.SidePanel.Slider.getEventFullName(s),e.events[s])}}}};BX.SidePanel.Slider.getEventFullName=function(t){return"SidePanel.Slider:"+t};BX.SidePanel.Slider.prototype={open:function(){if(this.isOpen()){return false}if(!this.canOpen()){return false}if(this.isDestroyed()){return false}this.createLayout();BX.addClass(this.getOverlay(),"side-panel-overlay-open side-panel-overlay-opening");this.adjustLayout();BX.ZIndexManager.bringToFront(this.getOverlay());this.opened=true;this.fireEvent("onOpenStart");this.animateOpening();return true},close:function(t,e){if(!this.isOpen()){return false}if(!this.canClose()){return false}this.fireEvent("onCloseStart");this.opened=false;if(this.isDestroyed()){return false}if(this.animation){this.animation.stop()}if(t===true||BX.browser.IsMobile()){this.currentParams=this.startParams;this.completeAnimation(e)}else{this.animation=new BX.easing({duration:this.animationDuration,start:this.currentParams,finish:this.startParams,transition:BX.easing.transitions.linear,step:BX.delegate((function(t){this.currentParams=t;this.animateStep(t)}),this),complete:BX.delegate((function(){this.completeAnimation(e)}),this)});this.animation.animate()}return true},getUrl:function(){return this.url},focus:function(){this.getWindow().focus()},isOpen:function(){return this.opened},setZindex:function(t){},getZindex:function(){var t=BX.ZIndexManager.getComponent(this.getOverlay());return t.getZIndex()},setOffset:function(t){if(BX.type.isNumber(t)||t===null){this.offset=t}},getOffset:function(){return this.offset},setWidth:function(t){if(BX.type.isNumber(t)){this.width=t}},getWidth:function(){return this.width},setTitle:function(t){if(BX.type.isNotEmptyString(t)){this.title=t}},getTitle:function(){return this.title},getData:function(){return this.data},isSelfContained:function(){return this.contentCallback!==null},isPostMethod:function(){return this.requestMethod==="post"},getRequestParams:function(){return this.requestParams},getFrameId:function(){if(this.iframeId===null){this.iframeId="iframe_"+BX.util.getRandomString(10).toLowerCase()}return this.iframeId},getWindow:function(){return this.iframe?this.iframe.contentWindow:window},getFrameWindow:function(){return this.iframe?this.iframe.contentWindow:null},isHidden:function(){return this.hidden},isCacheable:function(){return this.cacheable},isFocusable:function(){return this.autoFocus},isPrintable:function(){return this.printable},isDestroyed:function(){return this.destroyed},isLoaded:function(){return this.loaded},canChangeHistory:function(){return this.allowChangeHistory&&!this.isSelfContained()&&!this.getUrl().match(/^\/bitrix\/(components|tools)\//i)},canChangeTitle:function(){if(this.allowChangeTitle===null){if(this.getTitle()!==null){return true}return this.canChangeHistory()}return this.allowChangeTitle},setCacheable:function(t){this.cacheable=t!==false},setAutoFocus:function(t){this.autoFocus=t!==false},setPrintable:function(t){this.printable=t!==false;this.printable?this.showPrintBtn():this.hidePrintBtn()},getLoader:function(){return this.loader},showLoader:function(){var t=this.getLoader();if(!this.layout.loader){this.createLoader(t)}this.layout.loader.style.opacity=1;this.layout.loader.style.display="block"},closeLoader:function(){if(this.layout.loader){this.layout.loader.style.display="none";this.layout.loader.style.opacity=0}},showCloseBtn:function(){this.getLabel().showIcon()},hideCloseBtn:function(){this.getLabel().hideIcon()},showOrLightenCloseBtn:function(){if(BX.Type.isStringFilled(this.getLabel().getText())){this.getLabel().showIcon()}else{this.getLabel().lightenIcon()}},hideOrDarkenCloseBtn:function(){if(BX.Type.isStringFilled(this.getLabel().getText())){this.getLabel().hideIcon()}else{this.getLabel().darkenIcon()}},showPrintBtn:function(){this.getPrintBtn().classList.add("side-panel-print-visible")},hidePrintBtn:function(){this.getPrintBtn().classList.remove("side-panel-print-visible")},showExtraLabels:function(){this.getExtraLabelsContainer().style.removeProperty("display")},hideExtraLabels:function(){this.getExtraLabelsContainer().style.display="none"},setContentClass:function(t){if(BX.type.isNotEmptyString(t)){this.removeContentClass();this.contentClassName=t;this.getContentContainer().classList.add(t)}},removeContentClass:function(){if(this.contentClassName!==null){this.getContentContainer().classList.remove(this.contentClassName);this.contentClassName=null}},applyHacks:function(){},applyPostHacks:function(){},resetHacks:function(){},resetPostHacks:function(){},getTopBoundary:function(){return 0},calculateLeftBoundary:function(){var t=this.getCustomLeftBoundary();if(t!==null){return t}return this.getLeftBoundary()},getLeftBoundary:function(){var t=BX.browser.IsMobile()?window.innerWidth:document.documentElement.clientWidth;return t<1160?this.getMinLeftBoundary():300},getMinLeftBoundary:function(){return this.hideControls&&this.getCustomLeftBoundary()!==null?0:65},getLeftBoundaryOffset:function(){var t=this.getOffset()!==null?this.getOffset():0;return Math.max(this.calculateLeftBoundary(),this.getMinLeftBoundary())+t},setCustomLeftBoundary:function(t){if(BX.type.isNumber(t)||t===null){this.customLeftBoundary=t}},getCustomLeftBoundary:function(){return this.customLeftBoundary},setCustomRightBoundary:function(t){if(BX.type.isNumber(t)||t===null){this.customRightBoundary=t}},getCustomRightBoundary:function(){return this.customRightBoundary},calculateRightBoundary:function(){const t=this.getCustomRightBoundary();if(t!==null){return-window.pageXOffset+t}return this.getRightBoundary()},getRightBoundary:function(){return-window.pageXOffset},destroy:function(){if(this.isDestroyed()){return}this.firePageEvent("onDestroy");this.fireFrameEvent("onDestroy");var t=this.getFrameWindow();if(t){t.removeEventListener("keydown",this.handleFrameKeyDown);t.removeEventListener("focus",this.handleFrameFocus)}BX.Event.EventEmitter.unsubscribe("BX.Main.Popup:onInit",this.handlePopupInit);BX.ZIndexManager.unregister(this.layout.overlay);BX.remove(this.layout.overlay);this.layout.container=null;this.layout.overlay=null;this.layout.content=null;this.layout.closeBtn=null;this.layout.printBtn=null;this.layout.loader=null;this.iframe=null;this.destroyed=true;if(this.options.events){for(var e in this.options.events){BX.removeCustomEvent(this,BX.SidePanel.Slider.getEventFullName(e),this.options.events[e])}}return true},hide:function(){this.hidden=true;this.getContainer().style.display="none";this.getOverlay().style.display="none"},unhide:function(){this.hidden=false;this.getContainer().style.removeProperty("display");this.getOverlay().style.removeProperty("display")},reload:function(){if(this.isSelfContained()){this.contentCallbackInvoved=false;this.showLoader();this.setContent()}else{this.showLoader();this.getFrameWindow().location.reload()}},adjustLayout:function(){var t=window.pageYOffset||document.documentElement.scrollTop;var e=BX.browser.IsMobile()?window.innerHeight:document.documentElement.clientHeight;var i=this.getTopBoundary();var n=i-t>0;i=n?i:t;var s=n>0?e-i+t:e;var a=this.getLeftBoundaryOffset();var o=this.calculateRightBoundary();this.getOverlay().style.left=window.pageXOffset+"px";this.getOverlay().style.top=i+"px";this.getOverlay().style.right=o+"px";this.getOverlay().style.height=s+"px";this.getContainer().style.width="calc(100% - "+a+"px)";this.getContainer().style.height=s+"px";if(this.getWidth()!==null){this.getContainer().style.maxWidth=this.getWidth()+"px"}this.getLabel().adjustLayout()},createLayout:function(){if(this.layout.overlay!==null&&this.layout.overlay.parentNode){return}if(this.isSelfContained()){this.getContentContainer().style.overflow="auto";document.body.appendChild(this.getOverlay());this.setContent();BX.Event.EventEmitter.subscribe("BX.Main.Popup:onInit",this.handlePopupInit)}else{this.getContentContainer().appendChild(this.getFrame());document.body.appendChild(this.getOverlay());this.setFrameSrc()}BX.ZIndexManager.register(this.getOverlay())},getFrame:function(){if(this.iframe!==null){return this.iframe}this.iframe=BX.create("iframe",{attrs:{src:"about:blank",frameborder:"0"},props:{className:"side-panel-iframe",name:this.getFrameId(),id:this.getFrameId()},events:{load:this.handleFrameLoad.bind(this)}});return this.iframe},getOverlay:function(){if(this.layout.overlay!==null){return this.layout.overlay}this.layout.overlay=BX.create("div",{props:{className:"side-panel side-panel-overlay"},events:{mousedown:this.handleOverlayClick.bind(this)},children:[this.getContainer()]});return this.layout.overlay},unhideOverlay:function(){this.getOverlay().classList.remove("side-panel-overlay-hidden")},hideOverlay:function(){this.getOverlay().classList.add("side-panel-overlay-hidden")},hideShadow:function(){this.getContainer().classList.remove("side-panel-show-shadow")},showShadow:function(){this.getContainer().classList.add("side-panel-show-shadow")},setOverlayAnimation:function(t){if(BX.type.isBoolean(t)){this.overlayAnimation=t}},getOverlayAnimation:function(){return this.overlayAnimation},getContainer:function(){if(this.layout.container!==null){return this.layout.container}this.layout.container=BX.create("div",{props:{className:"side-panel side-panel-container"},children:this.hideControls?[this.getContentContainer()]:[this.getContentContainer(),this.getLabelsContainer(),this.getPrintBtn()]});return this.layout.container},getContentContainer:function(){if(this.layout.content!==null){return this.layout.content}this.layout.content=BX.create("div",{props:{className:"side-panel-content-container"+(this.contentClassName!==null?" "+this.contentClassName:"")}});return this.layout.content},getLabelsContainer:function(){return this.cache.remember("labels-container",function(){return BX.create("div",{props:{className:"side-panel-labels"},children:[this.getLabel().getContainer(),this.getExtraLabelsContainer()]})}.bind(this))},getExtraLabelsContainer:function(){return this.cache.remember("icon-labels",function(){return BX.create("div",{props:{className:"side-panel-extra-labels"},children:[this.newWindowLabel?this.newWindowLabel.getContainer():null,this.copyLinkLabel?this.copyLinkLabel.getContainer():null]})}.bind(this))},getCloseBtn:function(){return this.getLabel().getIconBox()},getLabel:function(){return this.label},getNewWindowLabel:function(){return this.newWindowLabel},getCopyLinkLabel:function(){return this.copyLinkLabel},getPrintBtn:function(){if(this.layout.printBtn!==null){return this.layout.printBtn}this.layout.printBtn=BX.create("span",{props:{className:"side-panel-print",title:BX.message("MAIN_SIDEPANEL_PRINT")},events:{click:this.handlePrintBtnClick.bind(this)}});return this.layout.printBtn},setContent:function(){if(this.contentCallbackInvoved){return}this.contentCallbackInvoved=true;BX.cleanNode(this.getContentContainer());var t=this.contentCallback(this);var e=t&&(Object.prototype.toString.call(t)==="[object Promise]"||t.toString()==="[object BX.Promise]");if(!e){t=Promise.resolve(t)}t.then(function(t){if(this.isDestroyed()){return}if(BX.type.isPlainObject(t)&&BX.type.isNotEmptyString(t.html)){BX.html(this.getContentContainer(),t.html).then(function(){this.removeLoader();this.loaded=true;this.firePageEvent("onLoad")}.bind(this),function(t){this.removeLoader();this.getContentContainer().innerHTML=t}.bind(this))}else{if(BX.type.isDomNode(t)){this.getContentContainer().appendChild(t)}else if(BX.type.isNotEmptyString(t)){this.getContentContainer().innerHTML=t}this.removeLoader();this.loaded=true;this.firePageEvent("onLoad")}}.bind(this),function(t){this.removeLoader();this.getContentContainer().innerHTML=t}.bind(this))},setFrameSrc:function(){if(this.iframeSrc===this.getUrl()){return}var t=BX.util.add_url_param(this.getUrl(),{IFRAME:"Y",IFRAME_TYPE:"SIDE_SLIDER"});if(this.isPostMethod()){var e=document.createElement("form");e.method="POST";e.action=t;e.target=this.getFrameId();e.style.display="none";BX.util.addObjectToForm(this.getRequestParams(),e);document.body.appendChild(e);e.submit();BX.remove(e)}else{this.iframeSrc=this.getUrl();this.iframe.src=t}},createLoader:function(t){BX.remove(this.layout.loader);t=BX.type.isNotEmptyString(t)||BX.type.isElementNode(t)?t:"default-loader";var e=["task-new-loader","task-edit-loader","task-view-loader","crm-entity-details-loader","crm-button-view-loader","crm-webform-view-loader","create-mail-loader","view-mail-loader"];var i=null;if(BX.type.isElementNode(t)){this.layout.loader=this.createHTMLLoader(t)}else if(BX.util.in_array(t,e)&&this.loaderExists(t)){this.layout.loader=this.createOldLoader(t)}else if(t.charAt(0)==="/"){this.layout.loader=this.createSvgLoader(t)}else if(i=t.match(/^([a-z0-9-_.]+):([a-z0-9-_.]+)$/i)){var n=i[1];var s=i[2];var a="/bitrix/images/"+n+"/slider/"+s+".svg";this.layout.loader=this.createSvgLoader(a)}else{t="default-loader";this.layout.loader=this.createDefaultLoader()}this.getContainer().appendChild(this.layout.loader)},createSvgLoader:function(t){return BX.create("div",{props:{className:"side-panel-loader"},children:[BX.create("div",{props:{className:"side-panel-loader-container"},style:{backgroundImage:'url("'+t+'")'}})]})},createDefaultLoader:function(){return BX.create("div",{props:{className:"side-panel-loader"},children:[BX.create("div",{props:{className:"side-panel-default-loader-container"},html:'<svg class="side-panel-default-loader-circular" viewBox="25 25 50 50">'+"<circle "+'class="side-panel-default-loader-path" '+'cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"'+"/>"+"</svg>"})]})},createOldLoader:function(t){if(t==="crm-entity-details-loader"){return BX.create("div",{props:{className:"side-panel-loader "+t},children:[BX.create("img",{attrs:{src:""+"///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask top"}}),BX.create("div",{props:{className:"side-panel-loader-bg left"},children:[BX.create("img",{attrs:{src:""+"MVEX///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask left"}})]}),BX.create("div",{props:{className:"side-panel-loader-bg right"},children:[BX.create("img",{attrs:{src:""+"VEX///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask right"}})]})]})}else{return BX.create("div",{props:{className:"side-panel-loader "+t},children:[BX.create("img",{attrs:{src:""+"///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask left"}}),BX.create("img",{attrs:{src:""+"1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask right"}})]})}},createHTMLLoader:function(t){return BX.create("div",{children:[t]})},loaderExists:function(t){if(!BX.type.isNotEmptyString(t)){return false}for(var e=0;e<document.styleSheets.length;e++){var i=document.styleSheets[e];if(!BX.type.isNotEmptyString(i.href)||i.href.indexOf("sidepanel")===-1){continue}var n;try{n=i.rules||i.cssRules}catch(t){try{n=i.cssRules}catch(t){n=[]}}for(var s=0;s<n.length;s++){var a=n[s];if(BX.type.isNotEmptyString(a.selectorText)&&a.selectorText.indexOf(t)!==-1){return true}}}return false},removeLoader:function(){BX.remove(this.layout.loader);this.layout.loader=null},animateOpening:function(){if(this.isPrintable()){this.showPrintBtn()}if(this.animation){this.animation.stop()}if(BX.browser.IsMobile()){this.currentParams=this.endParams;this.animateStep(this.currentParams);this.completeAnimation();return}this.currentParams=this.currentParams?this.currentParams:this.startParams;this.animation=new BX.easing({duration:this.animationDuration,start:this.currentParams,finish:this.endParams,transition:BX.easing.transitions.linear,step:BX.delegate((function(t){this.currentParams=t;this.animateStep(t)}),this),complete:BX.delegate((function(){this.completeAnimation()}),this)});this.animation.animate()},animateStep:function(t){this.getContainer().style.transform="translateX("+t.translateX+"%)";if(t.translateX===0&&BX.browser.IsIE10()){this.getContainer().style.transform="none"}if(this.getOverlayAnimation()){this.getOverlay().style.backgroundColor="rgba(0, 0, 0, "+t.opacity/100+")"}},completeAnimation:function(t){this.animation=null;if(this.isOpen()){this.currentParams=this.endParams;BX.removeClass(this.getOverlay(),"side-panel-overlay-opening");this.firePageEvent("onBeforeOpenComplete");this.fireFrameEvent("onBeforeOpenComplete");this.firePageEvent("onOpenComplete");this.fireFrameEvent("onOpenComplete");if(!this.isLoaded()){this.showLoader()}if(this.isFocusable()){this.focus()}}else{this.currentParams=this.startParams;BX.removeClass(this.getOverlay(),"side-panel-overlay-open side-panel-overlay-opening");this.getContainer().style.removeProperty("width");this.getContainer().style.removeProperty("right");this.getContainer().style.removeProperty("max-width");this.getContainer().style.removeProperty("min-width");this.getCloseBtn().style.removeProperty("opacity");this.firePageEvent("onBeforeCloseComplete");this.fireFrameEvent("onBeforeCloseComplete");this.firePageEvent("onCloseComplete");this.fireFrameEvent("onCloseComplete");if(BX.type.isFunction(t)){t(this)}if(!this.isCacheable()){this.destroy()}}},firePageEvent:function(t){var e=this.getEvent(t);if(e===null){throw new Error("'eventName' is invalid.")}BX.onCustomEvent(this,e.getFullName(),[e]);if(BX.util.in_array(t,["onClose","onOpen"])){BX.onCustomEvent("BX.Bitrix24.PageSlider:"+t,[this]);BX.onCustomEvent("Bitrix24.Slider:"+t,[this])}return e},fireFrameEvent:function(t){var e=this.getEvent(t);if(e===null){throw new Error("'eventName' is invalid.")}var i=this.getFrameWindow();if(i&&i.BX&&i.BX.onCustomEvent){i.BX.onCustomEvent(this,e.getFullName(),[e]);if(BX.util.in_array(t,["onClose","onOpen"])){i.BX.onCustomEvent("BX.Bitrix24.PageSlider:"+t,[this]);i.BX.onCustomEvent("Bitrix24.Slider:"+t,[this])}}return e},fireEvent:function(t){this.firePageEvent(t);this.fireFrameEvent(t)},getEvent:function(t){var e=null;if(BX.type.isNotEmptyString(t)){e=new BX.SidePanel.Event;e.setSlider(this);e.setName(t)}else if(t instanceof BX.SidePanel.Event){e=t}return e},canOpen:function(){return this.canAction("open")},canClose:function(){return this.canAction("close")},canCloseByEsc:function(){return this.canAction("closeByEsc")},canAction:function(t){if(!BX.type.isNotEmptyString(t)){return false}var e="on"+t.charAt(0).toUpperCase()+t.slice(1);var i=this.firePageEvent(e);var n=this.fireFrameEvent(e);return i.isActionAllowed()&&n.isActionAllowed()},handleFrameLoad:function(t){var e=this.iframe.contentWindow;var i=e.location;if(i.toString()==="about:blank"){return}e.addEventListener("keydown",this.handleFrameKeyDown);e.addEventListener("focus",this.handleFrameFocus);if(BX.browser.IsMobile()){e.document.body.style.paddingBottom=window.innerHeight*2/3+"px"}var n=i.pathname+i.search+i.hash;this.iframeSrc=this.refineUrl(n);this.url=this.iframeSrc;if(this.isPrintable()){this.injectPrintStyles()}if(this.loaded){this.firePageEvent("onLoad");this.fireFrameEvent("onLoad");this.firePageEvent("onReload");this.fireFrameEvent("onReload")}else{this.loaded=true;this.firePageEvent("onLoad");this.fireFrameEvent("onLoad")}if(this.isFocusable()){this.focus()}this.closeLoader()},handleFrameKeyDown:function(t){if(t.keyCode!==27){return}var e=BX.findChildren(this.getWindow().document.body,{className:"popup-window"},false);for(var i=0;i<e.length;i++){var n=e[i];if(n.style.display==="block"){return}}var s=this.getWindow().document.documentElement.clientWidth/2;var a=this.getWindow().document.documentElement.clientHeight/2;var o=this.getWindow().document.elementFromPoint(s,a);if(BX.hasClass(o,"bx-core-dialog-overlay")||BX.hasClass(o,"bx-core-window")){return}if(BX.findParent(o,{className:"bx-core-window"})){return}this.firePageEvent("onEscapePress");this.fireFrameEvent("onEscapePress")},handlePopupInit:function(t){var e=t.getCompatData();var i=e[1];var n=e[2];if(!BX.Type.isElementNode(n.targetContainer)&&BX.Type.isElementNode(i)){if(this.getContentContainer().contains(i)){n.targetContainer=this.getContentContainer()}}},handleFrameFocus:function(t){this.firePageEvent("onFrameFocus")},handleOverlayClick:function(t){if(t.target!==this.getOverlay()||this.animation!==null){return}this.close();t.stopPropagation()},handlePrintBtnClick:function(t){if(this.isSelfContained()){var e=document.createElement("iframe");e.src="about:blank";e.name="sidepanel-print-frame";e.style.display="none";document.body.appendChild(e);var i=e.contentWindow;var n=i.document;n.open();n.write("<html><head>");var s="";var a=document.head.querySelectorAll("link, style");for(var o=0;o<a.length;o++){var r=a[o];s+=r.outerHTML}s+="<style>html, body { background: #fff !important; height: 100%; }</style>";n.write(s);n.write("</head><body>");n.write(this.getContentContainer().innerHTML);n.write("</body></html>");n.close();i.focus();i.print();setTimeout((function(){document.body.removeChild(e);window.focus()}),1e3)}else{this.focus();this.getFrameWindow().print()}},injectPrintStyles:function(){var t=this.getFrameWindow().document;var e="";var i=t.body.classList;for(var n=0;n<i.length;n++){var s=i[n];e+="."+s}var a="@media print { body"+e+" { "+"background: #fff !important; "+"-webkit-print-color-adjust: exact;"+"color-adjust: exact; "+"} }";var o=t.createElement("style");o.type="text/css";if(o.styleSheet){o.styleSheet.cssText=a}else{o.appendChild(t.createTextNode(a))}t.head.appendChild(o)},refineUrl:function(t){if(BX.type.isNotEmptyString(t)&&t.match(/IFRAME/)){return BX.util.remove_url_param(t,["IFRAME","IFRAME_TYPE"])}return t}};BX.SidePanel.Event=function(){this.slider=null;this.action=true;this.name=null};BX.SidePanel.Event.prototype={allowAction:function(){this.action=true},denyAction:function(){this.action=false},isActionAllowed:function(){return this.action},getSliderPage:function(){return this.slider},getSlider:function(){return this.slider},setSlider:function(t){if(t instanceof BX.SidePanel.Slider){this.slider=t}},getName:function(){return this.name},setName:function(t){if(BX.type.isNotEmptyString(t)){this.name=t}},getFullName:function(){return BX.SidePanel.Slider.getEventFullName(this.getName())}};BX.SidePanel.MessageEvent=function(t){BX.SidePanel.Event.apply(this);t=BX.type.isPlainObject(t)?t:{};if(!(t.sender instanceof BX.SidePanel.Slider)){throw new Error("'sender' is not an instance of BX.SidePanel.Slider")}this.setName("onMessage");this.setSlider(t.slider);this.sender=t.sender;this.data="data"in t?t.data:null;this.eventId=BX.type.isNotEmptyString(t.eventId)?t.eventId:null};BX.SidePanel.MessageEvent.prototype={__proto__:BX.SidePanel.Event.prototype,constructor:BX.SidePanel.MessageEvent,getSlider:function(){return this.slider},getSender:function(){return this.sender},getData:function(){return this.data},getEventId:function(){return this.eventId}};BX.SidePanel.Dictionary=function(t){if(t&&!BX.type.isPlainObject(t)){throw new Error("The argument must be a plain object.")}this.data=t?t:{}};BX.SidePanel.Dictionary.prototype={set:function(t,e){if(!BX.type.isNotEmptyString(t)){throw new Error("The 'key' must be a string.")}this.data[t]=e},get:function(t){return this.data[t]},delete:function(t){delete this.data[t]},has:function(t){return t in this.data},clear:function(){this.data={}},entries:function(){return this.data}};BX.SidePanel.Label=function(t,e){this.slider=t;this.color=null;this.bgColor=null;this.iconClass="";this.iconTitle="";this.onclick=null;this.text=null;this.cache=new BX.Cache.MemoryCache;var i=BX.Type.isPlainObject(e)?e:{};this.setBgColor(i.bgColor);this.setColor(i.color);this.setText(i.text);this.setIconClass(i.iconClass);this.setIconTitle(i.iconTitle);this.setOnclick(i.onclick)};BX.SidePanel.Label.MIN_LEFT_OFFSET=25;BX.SidePanel.Label.MIN_TOP_OFFSET=17;BX.SidePanel.Label.INTERVAL_TOP_OFFSET=50;BX.SidePanel.Label.prototype={getContainer:function(){return this.cache.remember("container",function(){return BX.create("div",{props:{className:"side-panel-label"},children:[this.getIconBox(),this.getTextContainer()],events:{click:this.handleClick.bind(this)}})}.bind(this))},adjustLayout:function(){var t=this.getSlider().getOverlay().offsetWidth-this.getSlider().getContainer().offsetWidth;if(t<=this.getSlider().getMinLeftBoundary()){this.hideText()}else{this.showText()}this.getContainer().style.maxWidth=t-BX.SidePanel.Label.MIN_LEFT_OFFSET+"px"},getIconBox:function(){return this.cache.remember("icon-box",function(){return BX.create("div",{props:{className:"side-panel-label-icon-box"},children:[this.getIconContainer()]})}.bind(this))},getIconContainer:function(){return this.cache.remember("icon-container",function(){return BX.create("div",{props:{className:"side-panel-label-icon "+this.getIconClass()}})}.bind(this))},handleClick:function(t){t.stopPropagation();var e=this.getOnclick();if(e){e(this,this.getSlider())}},showIcon:function(){this.getContainer().classList.remove("side-panel-label-icon--hide")},hideIcon:function(){this.getContainer().classList.add("side-panel-label-icon--hide")},darkenIcon:function(){this.getContainer().classList.add("side-panel-label-icon--darken")},lightenIcon:function(){this.getContainer().classList.remove("side-panel-label-icon--darken")},hideText:function(){this.getTextContainer().classList.add("side-panel-label-text-hidden")},showText:function(){this.getTextContainer().classList.remove("side-panel-label-text-hidden")},isTextHidden:function(){return this.getTextContainer().classList.contains("side-panel-label-text-hidden")},getTextContainer:function(){return this.cache.remember("text-container",function(){return BX.create("span",{props:{className:"side-panel-label-text"}})}.bind(this))},setColor:function(t){if(BX.type.isNotEmptyString(t)){this.color=t;this.getTextContainer().style.color=t}},getColor:function(){return this.color},setBgColor:function(t,e){if(BX.Type.isArray(t)){e=t[1];t=t[0]}if(BX.type.isNotEmptyString(t)){var i=t.match(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/);if(i){var n=i[1];if(n.length===3){n=n.replace(/([a-f0-9])/gi,"$1$1")}e=BX.type.isNumber(e)&&e>=0&&e<=100?e:95;var s=BX.util.hex2rgb(n);t="rgba("+s.r+","+s.g+","+s.b+","+e/100+")"}this.bgColor=t;this.getContainer().style.backgroundColor=t}else if(t===null){this.bgColor=t;this.getContainer().style.removeProperty("backgroundColor")}},getBgColor:function(){return this.bgColor},setText:function(t){if(BX.type.isNotEmptyString(t)){this.text=t;this.getTextContainer().textContent=t}else if(t===null){this.text=t;this.getTextContainer().textContent=""}},getText:function(){return this.text},setIconClass:function(t){if(BX.Type.isStringFilled(t)){BX.Dom.removeClass(this.getIconContainer(),this.iconClass);this.iconClass=t;BX.Dom.addClass(this.getIconContainer(),this.iconClass)}else if(t===null){BX.Dom.removeClass(this.getIconContainer(),this.iconClass);this.iconClass=t}},getIconClass:function(){return this.iconClass},setIconTitle:function(t){if(BX.Type.isStringFilled(t)||t===null){BX.Dom.attr(this.getIconBox(),"title",t);this.iconTitle=t}},getIconTitle:function(){return this.iconTitle},setOnclick:function(t){if(BX.Type.isFunction(t)||t===null){this.onclick=t}},getOnclick:function(){return this.onclick},getSlider:function(){return this.slider},moveAt:function(t){if(BX.type.isNumber(t)&&t>=0){this.getSlider().getLabelsContainer().style.top=BX.SidePanel.Label.MIN_TOP_OFFSET+t*BX.SidePanel.Label.INTERVAL_TOP_OFFSET+"px"}}}})();
//# sourceMappingURL=slider.map.js